<?php

/**
 */
function smarty_block_display_for($params, $content,
        Smarty_Internal_Template $template, &$repeat) {
    
    $result = "";
    
    if(!$repeat){
        $roles = ModulesContext::instance()->getCurrentUser()->getPermissions();
        $requiredRoles = $params["roles"];
        if(count(array_intersect($requiredRoles, $roles))){
            $result = $content;
        }
    }
    return $result;
}

?>
